<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    
    <title>爬虫|基于redis搭建IP代理池 | 一只咸鱼 | 努力学习最新姿势！！！</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="Python">
    <meta name="description" content="前言爬虫爬取网页数据时由于频繁访问会被锁定IP，返回错误响应码以及验证字母验证，可以动态使用ip代理解决。代理服务可以自己搭建，也可以购买收费的强力代理服务更靠谱。 基于redis的ip池示例： 搭建环境： 123456windows下载地址：https:&#x2F;&#x2F;github.com&#x2F;MicrosoftArchive&#x2F;redis&#x2F;releases#下载">
<meta property="og:type" content="article">
<meta property="og:title" content="爬虫|基于redis搭建IP代理池">
<meta property="og:url" content="http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/index.html">
<meta property="og:site_name" content="一只咸鱼">
<meta property="og:description" content="前言爬虫爬取网页数据时由于频繁访问会被锁定IP，返回错误响应码以及验证字母验证，可以动态使用ip代理解决。代理服务可以自己搭建，也可以购买收费的强力代理服务更靠谱。 基于redis的ip池示例： 搭建环境： 123456windows下载地址：https:&#x2F;&#x2F;github.com&#x2F;MicrosoftArchive&#x2F;redis&#x2F;releases#下载">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/2019021911000144.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190219111418637.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDkwMjUyNw==,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20190219112350857.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDkwMjUyNw==,size_16,color_FFFFFF,t_70">
<meta property="article:published_time" content="2020-04-06T07:46:00.000Z">
<meta property="article:modified_time" content="2020-04-06T08:35:46.308Z">
<meta property="article:author" content="Mr.Zhang">
<meta property="article:tag" content="Python">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/2019021911000144.png">
    
        <link rel="alternate" type="application/atom+xml" title="一只咸鱼" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">Mr.Zhang</h5>
          <a href="mailto:zhangticcc@163.com" title="zhangticcc@163.com" class="mail">zhangticcc@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                首页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                时间轴
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://weibo.com/u/5392412243" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                微博
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/zhangti0708" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                开源地址
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://blog.csdn.net/weixin_40902527" target="_blank" >
                <i class="icon icon-lg icon-rss"></i>
                技术博客
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://zhangticcc.gitee.io/webgis/" target="_blank" >
                <i class="icon icon-lg icon-globe"></i>
                GIS案例
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://mp.weixin.qq.com/s/p4TOhKcr4RZkZWzuMYyBEQ" target="_blank" >
                <i class="icon icon-lg icon-weixin"></i>
                微信订阅号
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">爬虫|基于redis搭建IP代理池</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">爬虫|基于redis搭建IP代理池</h1>
        <h5 class="subtitle">
            
                <time datetime="2020-04-06T07:46:00.000Z" itemprop="datePublished" class="page-time">
  2020-04-06
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E7%88%AC%E8%99%AB/">爬虫</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#前言"><span class="post-toc-number">1.</span> <span class="post-toc-text">前言</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#基于redis的ip池"><span class="post-toc-number">2.</span> <span class="post-toc-text">基于redis的ip池</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#搭建"><span class="post-toc-number">2.1.</span> <span class="post-toc-text">搭建</span></a></li></ol></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#爬虫动态代理"><span class="post-toc-number">3.</span> <span class="post-toc-text">爬虫动态代理</span></a></li></ol>
        </nav>
    </aside>


<article id="post-爬虫-基于redis搭建IP代理池"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">爬虫|基于redis搭建IP代理池</h1>
        <div class="post-meta">
            <time class="post-time" title="2020-04-06 15:46:00" datetime="2020-04-06T07:46:00.000Z"  itemprop="datePublished">2020-04-06</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E7%88%AC%E8%99%AB/">爬虫</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>爬虫爬取网页数据时由于频繁访问会被锁定IP，返回错误响应码以及验证字母验证，可以动态使用ip代理解决。<br>代理服务可以自己搭建，也可以购买收费的强力代理服务更靠谱。</p>
<h3 id="基于redis的ip池"><a href="#基于redis的ip池" class="headerlink" title="基于redis的ip池"></a>基于redis的ip池</h3><p>示例：<br><img alt="" class="has" height="195" src="https://img-blog.csdnimg.cn/2019021911000144.png" width="717"></p>
<h4 id="搭建"><a href="#搭建" class="headerlink" title="搭建"></a>搭建</h4><p>环境：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">windows下载地址：https:&#x2F;&#x2F;github.com&#x2F;MicrosoftArchive&#x2F;redis&#x2F;releases</span><br><span class="line">#下载zip解压即可</span><br><span class="line">启动redis：运行redis-server.exe</span><br><span class="line"> </span><br><span class="line">Linux安装：sudo apt-get install redis-server</span><br><span class="line">启动redis：运行redis-server</span><br></pre></td></tr></table></figure>

<p>安装启动：</p>
<img alt="" class="has" height="396" src="https://img-blog.csdnimg.cn/20190219111418637.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDkwMjUyNw==,size_16,color_FFFFFF,t_70" width="957">

<p>部署本地ip爬虫</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">#下载源码</span><br><span class="line">git clone git@github.com:jhao104&#x2F;proxy_pool.git</span><br><span class="line">或者直接到</span><br><span class="line">https:&#x2F;&#x2F;github.com&#x2F;jhao104&#x2F;proxy_pool </span><br><span class="line">下载zip文件，解压出来</span><br></pre></td></tr></table></figure>

<p>安装依赖：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">#进入项目目录执行pip命令 也可以手动安装</span><br><span class="line">pip install -r requirements.txt</span><br></pre></td></tr></table></figure>

<p>配置项目：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"># Config&#x2F;setting.py 为项目配置文件</span><br><span class="line"> </span><br><span class="line"># 配置DB     </span><br><span class="line">DATABASES &#x3D; &#123;</span><br><span class="line">    &quot;default&quot;: &#123;</span><br><span class="line">        &quot;TYPE&quot;: &quot;SSDB&quot;,        # 如果使用SSDB或redis数据库，均配置为SSDB</span><br><span class="line">        &quot;HOST&quot;: &quot;127.0.0.1&quot;,   # db host</span><br><span class="line">        &quot;PORT&quot;: 6379,          # db port redis默认6379</span><br><span class="line">        &quot;NAME&quot;: &quot;proxy&quot;,       # 默认配置</span><br><span class="line">        &quot;PASSWORD&quot;: &quot;&quot;         # db password</span><br><span class="line"> </span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"> </span><br><span class="line"># 配置 ProxyGetter</span><br><span class="line">PROXY_GETTER &#x3D; [</span><br><span class="line">    &quot;freeProxyFirst&quot;,      # 这里是启用的代理抓取函数名，可在ProxyGetter&#x2F;getFreeProxy.py 扩展</span><br><span class="line">    &quot;freeProxySecond&quot;,</span><br><span class="line">    ....</span><br><span class="line">]</span><br><span class="line"> </span><br><span class="line"># 配置 API服务 </span><br><span class="line">SERVER_API &#x3D; &#123;</span><br><span class="line">    &quot;HOST&quot;: &quot;0.0.0.0&quot;,  # 监听ip, 0.0.0.0 监听所有IP</span><br><span class="line">    &quot;PORT&quot;: 5010        # 监听端口</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">#上面配置启动后，代理池访问地址为 http:&#x2F;&#x2F;127.0.0.1:5010</span><br></pre></td></tr></table></figure>

<p>启动项目：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"># 如果你的依赖已经安全完成并且具备运行条件,可以直接在Run下运行main.py</span><br><span class="line"># 到Run目录下:</span><br><span class="line">&gt;&gt;&gt;python main.py</span><br><span class="line"> </span><br><span class="line"># 如果运行成功你应该看到有4个main.py进程</span><br><span class="line"> </span><br><span class="line"># 你也可以分别运行他们,</span><br><span class="line"># 依次到Api下启动ProxyApi.py,Schedule下启动ProxyRefreshSchedule.py和ProxyValidSchedule.py即可.</span><br></pre></td></tr></table></figure>

<p>启动查看抓取的ip：<code>http://127.0.0.1:5010/get_all/</code></p>
<p>项目提供内置API:<br><img alt="" class="has" height="271" src="https://img-blog.csdnimg.cn/20190219112350857.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDkwMjUyNw==,size_16,color_FFFFFF,t_70" width="536"></p>
<h3 id="爬虫动态代理"><a href="#爬虫动态代理" class="headerlink" title="爬虫动态代理"></a>爬虫动态代理</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">def get_proxy():</span><br><span class="line">    #可以换成我的Api</span><br><span class="line">    return requests.get(&quot;http:&#x2F;&#x2F;127.0.0.1:5010&#x2F;get&#x2F;&quot;).text</span><br><span class="line"> </span><br><span class="line">def getURL(self, url, redirects&#x3D;False, tries_num&#x3D;6, sleep_time&#x3D;0.5, time_out&#x3D;1000, max_retry&#x3D;6, ):</span><br><span class="line">        #从ip池动态获取一个ip</span><br><span class="line">        proxy &#x3D; get_proxy()</span><br><span class="line">        try:</span><br><span class="line">            res &#x3D; requests.Session()</span><br><span class="line">           # res &#x3D; requests.get(url,headers&#x3D;self.randHeader(), allow_redirects&#x3D;redirects, timeout&#x3D;time_out)</span><br><span class="line">            res &#x3D; requests.get(url,headers&#x3D;self.randHeader(), allow_redirects&#x3D;redirects, timeout&#x3D;time_out, proxies&#x3D;&#123;&quot;http&quot;: &quot;http:&#x2F;&#x2F;&#123;&#125;&quot;.format(proxy), &quot;https&quot;: &quot;https:&#x2F;&#x2F;&#123;&#125;&quot;.format(proxy)&#125;)</span><br><span class="line">            res.raise_for_status()  # 如果响应状态码不是 200，就主动抛出异常</span><br><span class="line"> </span><br><span class="line">        except requests.RequestException as e:</span><br><span class="line">            sleep_time_p &#x3D; sleep_time_p + 10</span><br><span class="line">            time_out_p &#x3D; time_out_p + 10</span><br><span class="line">            tries_num_p &#x3D; tries_num_p - 1</span><br><span class="line">            # 设置重试次数，最大timeout 时间和 最长休眠时间</span><br><span class="line">            if tries_num_p &gt; 0:</span><br><span class="line">                time.sleep(sleep_time_p)</span><br><span class="line">                print (self.getCurrentTime(), url, &#39;URL Connection Error: 第&#39;, max_retry - tries_num_p, u&#39;次 Retry Connection&#39;, e)</span><br><span class="line">                return self.getURL(url, &#39;False&#39;, tries_num_p, sleep_time_p, time_out_p, max_retry)</span><br><span class="line">        return res</span><br></pre></td></tr></table></figure>





        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2020-04-06T08:35:46.308Z" itemprop="dateUpdated">2020-04-06 16:35:46</time>
</span><br>


        
        这里可以写作者留言，标签和 hexo 中所有变量及辅助函数等均可调用，示例：<a href="/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/" target="_blank" rel="external">http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/</a>
        
    </div>
    
    <footer>
        <a href="http://yoursite.com">
            <img src="/img/avatar.jpg" alt="Mr.Zhang">
            Mr.Zhang
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python/" rel="tag">Python</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/&title=《爬虫|基于redis搭建IP代理池》 — 一只咸鱼&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/&title=《爬虫|基于redis搭建IP代理池》 — 一只咸鱼&source=分享各种福利和姿势..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《爬虫|基于redis搭建IP代理池》 — 一只咸鱼&url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2020/04/06/python-%E8%81%8A%E5%A4%A9%E5%AE%A4/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">python| socket聊天室</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8E%E9%AB%98%E5%BE%B7api%E6%8E%A5%E5%8F%A3%E6%8A%93%E5%8F%96%E6%99%AF%E5%8C%BA-%E5%B0%8F%E5%8C%BA%E8%BE%B9%E7%95%8C%E6%95%B0%E6%8D%AE/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">爬虫| 基于高德api接口抓取景区/小区边界数据</h4>
      </a>
    </div>
  
</nav>



    




















</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢大爷~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/img/wechat.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="/img/wechat.jpg" data-alipay="/img/alipay.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>Mr.Zhang &copy; 2015 - 2020</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/&title=《爬虫|基于redis搭建IP代理池》 — 一只咸鱼&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/&title=《爬虫|基于redis搭建IP代理池》 — 一只咸鱼&source=分享各种福利和姿势..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《爬虫|基于redis搭建IP代理池》 — 一只咸鱼&url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=http://yoursite.com/2020/04/06/%E7%88%AC%E8%99%AB-%E5%9F%BA%E4%BA%8Eredis%E6%90%AD%E5%BB%BAIP%E4%BB%A3%E7%90%86%E6%B1%A0/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
